import store from '@/store';
import router from '@/router';
export default {
    bind(el,binding){
        if(!binding.value){
            console.error('v-aclid 指令参数不可为空，参数为当前元素的Aclid')
            return
        }
        const aclid = binding.value.toString()
        const currentRouteId = router.currentRoute.meta.id
        const elements = store.getters.elements[currentRouteId] ? store.getters.elements[currentRouteId].map(item => {
            return item.elementAclId
        }) : []
        if(!elements.includes(aclid)){
            // 异步执行
            setTimeout(function () {
                el.remove()
            },0)
        }
    },
    unbind(){

    }
}
